define(function(require, exports) {
			var $ = require('commplugin/jquery');
			require('commplugin/jqtemplate')($);
			require('commplugin/bootstrap')($);
			var base = require('base/base');
			var util = base.util;
			/**
			 * 当前页面的所有action控制器
			 */
			var actionControl = {
				loadNav : function(hash) {
					var model = {
							navs : [{
										name : "item1"
									}, {
										name : "item2"
									}, {
										name : "item3"
									}, {
										name : "item4"
									}],
							className:"nav"
						};
					
					var tpl = $.template(Temp.nav,model);
					
					
				},
				loadDialog:function(){
					
				},
				loadUser : function(hash) {
					console.log(hash.action);
				}
			};
			//table切换控制器
			var tabInitControl={
				home:function(){
					util.dialog({
						title:"弹出测试",
						body:"sss"
					});
				}
			}
			
			exports.init = function(view) {
				// 绑定浏览器hash值改变检测
				base.init({actionControl:actionControl,$:$});
				
				//初始化tab切换
				$('#myTab a').click(function (e) {
				  e.preventDefault();
				  $(this).tab('show');
				})
				//tab切换后的事件
				$('a[data-toggle="tab"]').on('shown', function (e) {
				 /* console.log(e.target.innerHTML);
				  console.log(e.relatedTarget.innerHTML);*/
				  //得到当前面板控制器并调用
				  var control = e.target.getAttribute("control");
				  tabInitControl[control](e.target);
				})
				
			};

/**
 * 当前页面模板,模板书写形式和jsp一样。只是<%   %>里面写的是js代码
 */
Temp={};
Temp.nav='\
<ul class="<%=className %>">\
	<%for(var i=0,n = navs.length;i<n;i++){%>\
	<li><%=navs[i].name%></li>\
	<%}%>\
</ul>';
			
		});
		
/*公共模板*/
cTemp={};
cTemp.model='<div id="myModal" class="modal hide fade">\
            <div class="modal-header">\
              <button type="button" class="close" data-dismiss="modal">×</button>\
              <h3>Modal Heading</h3>\
            </div>\
            <div class="modal-body">\
			<%=body %>\
            </div>\
            <div class="modal-footer">\
              <a href="#" class="btn" data-dismiss="modal">Close</a>\
              <a href="#" class="btn btn-primary">Save changes</a>\
            </div>\
          </div>'